package com.apes.fn.server.pickUpCar.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.apes.framework.jpa.ApesBean;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.DateUtil;
import com.apes.scm.masterdata.party.model.PartyRole;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * @Classname PickUpCar
 * @Description 接车单操作纪录
 * @Date 2020/1/14 15:06
 * @Created by Administrator
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = PickUpCarItem.CONST_TABLE_NAME)
public class PickUpCarItem implements ApesBean {
    public static final String CONST_TABLE_NAME = "fn_pick_up_car_item";

    @Id
    @Column(name = "id")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "接车单随车物品")
    @Comment("ID")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name ="pick_up_car_id" ,referencedColumnName = "id")
    @Comment("接车单号")
    private PickUpCar pickUpCar;

    // @ManyToOne(fetch = FetchType.LAZY)
    // @JoinColumn(name = "operator_id" ,referencedColumnName = "id")
    // @Comment("操作员")
    // private PartyRole operator;
    //
    // @JSONField(format = DateUtil.SHOW_DATETIME_FORMAT)
    // @Temporal(TemporalType.TIMESTAMP)
    // @Comment("操作时间")
    // @Column(name = "operate_date")
    // private Date operateDate;
    @Column(name = "name",length = 32)
    @Comment("名称")
    private String name;
}
